home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_mastercontrol.cog < prev    next >
Text File  |  1999-11-15  |  11KB  |  438 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_MasterControl.cog
  4. #
  5. # Controls the little green lights on the control panel.
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     
  14.     message     user0
  15.     message     pulse
  16.     message     timer
  17.     
  18.     # ** Panel switches **
  19.     surface     switch1
  20.     surface        switch2
  21.     surface        switch3
  22.     surface        switch4
  23.     surface        switch5
  24.     
  25.     # ** Loop 1 **
  26.     surface     loop1Lt0
  27.     surface     loop1Lt1
  28.     surface     loop1Lt2
  29.     surface     loop1Lt3
  30.     surface     loop1Lt4
  31.     surface     loop1Lt5
  32.     
  33.     # ** Loop 2 **
  34.     surface     loop2Lt0
  35.     surface     loop2Lt1
  36.     surface     loop2Lt2
  37.     surface     loop2Lt3
  38.     surface     loop2Lt4
  39.     surface     loop2Lt5
  40.     
  41.     # ** Loop 3 **
  42.     surface     loop3Lt0
  43.     surface     loop3Lt1
  44.     surface     loop3Lt2
  45.     surface     loop3Lt3
  46.     surface     loop3Lt4
  47.     surface     loop3Lt5
  48.  
  49.     # ** Loop 4 **
  50.     surface     loop4Lt0
  51.     surface     loop4Lt1
  52.     surface     loop4Lt2
  53.     surface     loop4Lt3
  54.     surface     loop4Lt4
  55.     surface     loop4Lt5
  56.     surface     loop4Lt6
  57.  
  58.     # ** Loop 5 **
  59.     surface     loop5Lt0
  60.     surface     loop5Lt1
  61.     surface     loop5Lt2
  62.     
  63.     # ** Loop 6 **
  64.     surface     loop6Lt0
  65.     surface     loop6Lt1
  66.     surface     loop6Lt2
  67.     surface     loop6Lt3
  68.     surface     loop6Lt4
  69.     surface     loop6Lt5
  70.     
  71.     # ** Start Loops **
  72.     int         startLoop1=0        local
  73.     int         startLoop2=0        local
  74.     int         startLoop3=0        local
  75.     int         startLoop4=0        local
  76.     int         startLoop5=0        local
  77.     int         startLoop6=0        local    
  78.  
  79.     # ** Loop Timers **
  80.     int         loop1Time=0         local
  81.     int         loop2Time=0         local
  82.     int         loop3Time=0         local
  83.     int         loop4Time=0         local
  84.     int         loop5Time=0         local
  85.     int         loop6Time=0         local
  86.     
  87.     # ** math **
  88.     int         count1=0            local
  89.     int         count2=0            local
  90.     int         count3=0            local
  91.     int         count4=0            local
  92.     int         count5=0            local
  93.     int         count6=0            local
  94.     
  95.     # ** misc **
  96.     thing       ghostPos
  97.     sound       bing=sol_panel_position_c.wav       local
  98.     int         pause=2.0           local
  99.  
  100. end
  101.  
  102. # ========================================================================================
  103.  
  104. code
  105.  
  106. user0:
  107.  
  108.     startLoop1 = 1;
  109.     SetPulse(1.0);
  110.     return;
  111.         
  112. # ========================================================================================
  113.  
  114. pulse:
  115.  
  116.     PlaySoundThing(bing, ghostPos, 0.5, 4.0, 8.0, 0x0);
  117.     
  118. # LOOP 1
  119.     if(count1 == 6)
  120.     {
  121.         count1 = 0;
  122.         #Print("reset 1");
  123.     }
  124.         
  125.     
  126.     if(startLoop1 == 1)
  127.     {
  128.         #Print("Loop1");
  129.         SetPulse(3.0);
  130.         count1 = count1 + 1;
  131.         SetWallCel(loop1Lt0[count1-1], 1);
  132.         #PrintInt(count1-1);
  133.         loop1Time = 1;
  134.         SetTimer(2.0);
  135.  
  136.         if((GetWallCel(loop1Lt2) == 1) && (GetWallCel(switch1) == 2))
  137.         {
  138.             count2 = 0;
  139.             count4 = 0;
  140.             count6 = 0;
  141.             startLoop1 = 0;
  142.             Sleep(2.0);
  143.             SetWallCel(loop1Lt2, 0);
  144.             Sleep(1.0);
  145.             startLoop2 = 1;
  146.         }
  147.     }
  148.         
  149. # LOOP 2
  150.     if(count2 == 6)
  151.     {
  152.         count2 = 0;
  153.         #Print("reset 2");
  154.     }
  155.         
  156.     if(startLoop2 == 1)
  157.     {
  158.         #Print("Loop2");
  159.         SetPulse(3.0);
  160.         count2 = count2 + 1;
  161.         SetWallCel(loop2Lt0[count2-1], 1);
  162.         #PrintInt(count2-1);
  163.         loop2Time = 1;
  164.         SetTimer(pause);
  165.         
  166.         # If switch1 is thrown do this    
  167.         if((GetWallCel(loop2Lt4) == 1) && (GetWallCel(switch1) == 1))
  168.         {
  169.             count1 = 3;
  170.             startLoop2 = 0;
  171.             Sleep(2.0);
  172.             SetWallCel(loop2Lt5, 0);
  173.             # Sleep(1.0);
  174.             startLoop1 = 1;
  175.         }
  176.             
  177.         # If switch2 is thrown do this    
  178.         if((GetWallCel(loop2Lt1) == 1) && (GetWallCel(switch2) == 2))
  179.         {
  180.             count3 = 0;
  181.             startLoop2 = 0;
  182.             Sleep(2.0);
  183.             SetWallCel(loop2Lt1, 0);
  184.             Sleep(1.0);
  185.             startLoop3 = 1;
  186.         }
  187.         
  188.         # If switch3 is thrown do this    
  189.         if((GetWallCel(loop2Lt2) == 1) && (GetWallCel(switch3) == 2))
  190.         {
  191.             startLoop2 = 0;
  192.             Sleep(2.0);
  193.             SetWallCel(loop2Lt2, 0);
  194.             Sleep(1.0);
  195.             startLoop4 = 1;
  196.         }
  197.         
  198.         # If switch4 is thrown do this
  199.         if((GetWallCel(loop2Lt0) == 1) && (GetWallCel(switch4) == 2))
  200.         {
  201.             startLoop2 = 0;
  202.             Sleep(2.0);
  203.             SetWallCel(loop2Lt0, 0);
  204.             Sleep(1.0);
  205.             startLoop5 = 1;
  206.         }
  207.     }
  208.         
  209. # LOOP 3
  210.     if(count3 == 6)
  211.     {
  212.         count3 = 0;
  213.         #Print("reset 3");
  214.     }
  215.     
  216.     if(startLoop3 == 1)
  217.     {
  218.         #Print("Loop3");
  219.         SetPulse(3.0);
  220.         count3 = count3 + 1;
  221.         SetWallCel(loop3Lt0[count3-1], 1);
  222.         #PrintInt(count3-1);
  223.         loop3Time = 1;
  224.         SetTimer(pause);
  225.  
  226.         # If switch1 is thrown do this    
  227.         if((GetWallCel(loop3Lt3) == 1) && (GetWallCel(switch1) == 1))
  228.         {
  229.             startLoop3 = 0;
  230.             Sleep(2.0);
  231.             SetWallCel(loop3Lt3, 0);
  232.             # Sleep(1.0);
  233.             startLoop1 = 1;
  234.         }
  235.             
  236.         # If switch2 is thrown do this    
  237.         if((GetWallCel(loop3Lt5) == 1) && (GetWallCel(switch2) == 1))
  238.         {
  239.             startLoop3 = 0;
  240.             Sleep(2.0);
  241.             SetWallCel(loop3Lt5, 0);
  242.             # Sleep(1.0);
  243.             startLoop2 = 1;
  244.         }
  245.         
  246.         # If switch4 is thrown do this
  247.         if((GetWallCel(loop3Lt4) == 1) && (GetWallCel(switch4) == 2))
  248.         {
  249.             count6 = 0;
  250.             startLoop3 = 0;
  251.             Sleep(2.0);
  252.             SetWallCel(loop3Lt4, 0);
  253.             Sleep(1.0);
  254.             startLoop5 = 1;
  255.         }
  256.     }
  257.         
  258. # LOOP 4
  259.     if(count4 == 7)
  260.     {
  261.         count4 = 0;
  262.         #Print("reset 4");
  263.     }
  264.     
  265.     if(startLoop4 == 1)
  266.     {
  267.         #Print("Loop4");
  268.         SetPulse(3.0);
  269.         count4 = count4 + 1;
  270.         SetWallCel(loop4Lt0[count4-1], 1);
  271.         #PrintInt(count4-1);
  272.         loop4Time = 1;
  273.         SetTimer(pause);
  274.     
  275.         # If switch1 is thrown do this    
  276.         if((GetWallCel(loop4Lt3) == 1) && (GetWallCel(switch1) == 1))
  277.         {
  278.             startLoop4 = 0;
  279.             Sleep(2.0);
  280.             SetWallCel(loop4Lt3, 0);
  281.             # Sleep(1.0);
  282.             startLoop1 = 1;
  283.         }
  284.             
  285.         # If switch2 is thrown do this    
  286.         if((GetWallCel(loop4Lt5) == 1) && (GetWallCel(switch2) == 2))
  287.         {
  288.             startLoop4 = 0;
  289.             # Sleep(2.0);
  290.             # SetWallCel(loop4Lt5, 0);
  291.             # Sleep(1.0);
  292.             startLoop3 = 1;
  293.         }
  294.         
  295.         # If switch3 is thrown do this    
  296.         if((GetWallCel(loop4Lt6) == 1) && (GetWallCel(switch3) == 1))
  297.         {
  298.             startLoop4 = 0;
  299.             Sleep(2.0);
  300.             SetWallCel(loop4Lt6, 0);
  301.             Sleep(1.0);
  302.             startLoop2 = 1;
  303.         }
  304.         
  305.         # If switch4 is thrown do this
  306.         if((GetWallCel(loop4Lt4) == 1) && (GetWallCel(switch4) == 2))
  307.         {
  308.             startLoop4 = 0;
  309.             Sleep(2.0);
  310.             SetWallCel(loop4Lt4, 0);
  311.             Sleep(1.0);
  312.             startLoop5 = 1;
  313.         }
  314.     }
  315.         
  316. # LOOP 5 -- dead end loop
  317.     if(count5 == 3)
  318.     {
  319.         #Print("cutscene of commies flying off tracks");
  320.         SetPulse(0);
  321.         return;
  322.     }
  323.     
  324.     if(startLoop5 == 1)
  325.     {
  326.         #Print("Loop5");
  327.         SetPulse(3.0);
  328.         count5 = count5 + 1;
  329.         SetWallCel(loop5Lt0[count5-1], 1);
  330.         #PrintInt(count5-1);
  331.         loop5Time = 1;
  332.         SetTimer(pause);
  333.         
  334.         # If switch5 is thrown do this    
  335.         if((GetWallCel(loop5Lt0) == 1) && (GetWallCel(switch5) == 2))
  336.         {
  337.             count5 = 0;
  338.             startLoop5 = 0;
  339.             Sleep(2.0);
  340.             SetWallCel(loop5Lt0, 0);
  341.             Sleep(1.0);
  342.             startLoop6 = 1;
  343.         }
  344.     }
  345.  
  346. # LOOP 6
  347.     if(count6 == 6)
  348.     {
  349.         count6 = 0;
  350.         #Print("reset 6");
  351.     }
  352.     
  353.     if(startLoop6 == 1)
  354.     {
  355.         #Print("Loop6");
  356.         SetPulse(3.0);
  357.         count6 = count6 + 1;
  358.         SetWallCel(loop6Lt0[count6-1], 1);
  359.         #PrintInt(count6-1);
  360.         loop6Time = 1;
  361.         SetTimer(pause);
  362.     
  363.         # If switch1 is thrown do this    
  364.         if((GetWallCel(loop6Lt3) == 1) && (GetWallCel(switch1) == 1))
  365.         {
  366.             startLoop6 = 0;
  367.             Sleep(2.0);
  368.             SetWallCel(loop6Lt3, 0);
  369.             # Sleep(1.0);
  370.             startLoop1 = 1;
  371.         }
  372.             
  373.         # If switch4 is thrown do this
  374.         if((GetWallCel(loop6Lt4) == 1) && (GetWallCel(switch4) == 1))
  375.         {
  376.             count2 = 1;
  377.             startLoop6 = 0;
  378.             Sleep(2.0);
  379.             SetWallCel(loop6Lt4, 0);
  380.             # Sleep(1.0);
  381.             startLoop2 = 1;
  382.         }
  383.     
  384.         # If switch5 is thrown do this
  385.         if((GetWallCel(loop6Lt5) == 1) && (GetWallCel(switch5) == 1))
  386.         {
  387.             count5 = 1;
  388.             startLoop6 = 0;
  389.             Sleep(2.0);
  390.             SetWallCel(loop6Lt5, 0);
  391.             # Sleep(1.0);
  392.             startLoop5 = 1;
  393.         }
  394.     }
  395.         
  396. return;
  397.         
  398. # ========================================================================================
  399.  
  400. timer:
  401.  
  402.     if(loop1Time == 1)
  403.     {
  404.         SetWallCel(loop1Lt0[count1-1], 0);
  405.     }
  406.     
  407.     if(loop2Time == 1)
  408.     {
  409.         SetWallCel(loop2Lt0[count2-1], 0);
  410.     }
  411.     
  412.     if(loop3Time == 1)
  413.     {
  414.         SetWallCel(loop3Lt0[count3-1], 0);
  415.     }
  416.     
  417.     if(loop4Time == 1)
  418.     {
  419.         SetWallCel(loop4Lt0[count4-1], 0);
  420.     }
  421.     
  422.     if(loop5Time == 1)
  423.     {
  424.         SetWallCel(loop5Lt0[count5-1], 0);
  425.     }
  426.     
  427.     if(loop6Time == 1)
  428.     {
  429.         SetWallCel(loop6Lt0[count6-1], 0);
  430.     }
  431.     
  432.     return;
  433.  
  434. # ========================================================================================
  435.  
  436. end
  437.  
  438.